#include <bits/stdc++.h>
using namespace std;
#define int long long
int n, m, t, sx, sy, fx, fy, ans = 0;
int a[110][110];
int d[110][110];
void dfs(int x, int y)
{
    if (x == fx && y == fy)
    {
        ans++;
        return;
    }
    int dx[] = {0, 0, 1, -1};
    int dy[] = {1, -1, 0, 0};
    for (int i = 0; i < 4; i++)
    {
        int tx = x + dx[i], ty = y + dy[i];
        if (a[tx][ty] == 1 && d[tx][ty] == 0)
        {
            d[x][y] = 1;
            dfs(tx, ty);
            d[x][y] = 0;
        }
    }
}
signed main()
{

    cin >> n >> m >> t;
    for (int i = 1; i <= n;i++)
    {
        for (int j = 1; j <= m;j++)
        {
            a[i][j] = 1;
        }
    }
        cin >> sx >> sy >> fx >> fy;
    while (t--)
    {
        int q, w;
        cin >> q >> w;
        d[q][w] = 1;
    }
    dfs(sx, sy);
    cout << ans << endl;
    return 0;
}